﻿namespace QLBanHang.UC
{
    using ConfigDatabase.Class;
    using DevExpress.Utils;
    using DevExpress.XtraBars;
    using DevExpress.XtraEditors;
    using DevExpress.XtraEditors.Mask;
    using DevExpress.XtraEditors.Repository;
    using DevExpress.XtraGrid;
    using DevExpress.XtraGrid.Columns;
    using DevExpress.XtraGrid.Views.Base;
    using DevExpress.XtraGrid.Views.Grid;
    using DevExpress.XtraTab;
    using DevExpress.XtraTreeList;
    using DevExpress.XtraTreeList.Columns;
    using DevExpress.XtraTreeList.Nodes;
    using BaseClass.Chung;
    using System;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Drawing.Drawing2D;
    using System.Windows.Forms;

    public class UCquanlydangnhap : XtraUserControl
    {
        private ConnectDatabase _condata;
        private DataTable _dataChucNang;
        private dtoDMDangNhap _dtodn;
        private string _quyen_coppy = "";
        private string _quyen_ht = "";
        private string _quyen_undo = "";
        private Bar bar1;
        private Bar bar2;
        private Bar bar3;
        private BarDockControl barDockControl1;
        private BarDockControl barDockControlBottom;
        private BarDockControl barDockControlLeft;
        private BarDockControl barDockControlRight;
        private BarDockControl barDockControlTop;
        private BarManager barManager1;
        private BarButtonItem bbihuy;
        private BarButtonItem bbisua;
        private BarButtonItem bbithem;
        private SimpleButton btnketthuc;
        private SimpleButton btnluu;
        private IContainer components = null;
        private ContextMenuStrip contextMenuStrip1;
        private GridControl gridds;
        private GridColumn gridds_id;
        private GridColumn gridds_matkhau;
        private GridColumn gridds_nhomsudung;
        private GridColumn gridds_quyensudung;
        private GridColumn gridds_ten;
        private GridColumn gridds_tendangnhap;
        private GridView gridView1;
        private RepositoryItemCheckEdit repositoryItemCheckEdit1;
        private RepositoryItemTextEdit repositoryItemTextEdit1;
        private RepositoryItemTextEdit repositoryItemTextEdit2;
        private ToolStripMenuItem saoChépQuyềnSửDụngToolStripMenuItem;
        private ToolStripMenuItem smipast;
        private ToolStripMenuItem smiundo;
        private TreeList treeList1;
        private TreeListColumn treeListColumn1;
        private TreeListColumn treeListColumn4;

        public UCquanlydangnhap()
        {
            this.InitializeComponent();
        }

        private void bbihuy_ItemClick(object sender, ItemClickEventArgs e)
        {
            try
            {
                int rowHandle = this.gridView1.GetSelectedRows()[0];
                string str = this.gridView1.GetRowCellValue(rowHandle, this.gridds_ten).ToString();
                string str2 = this.gridView1.GetRowCellValue(rowHandle, this.gridds_tendangnhap).ToString();
                if (MessageBox.Show("Bạn c\x00f3 chắc chắn muốn hủy th\x00f4ng tin đăng nhập:\n" + str2 + "(" + str + ") ?", "Th\x00f4ng b\x00e1o", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.No)
                {
                    this._dtodn = new dtoDMDangNhap(this._condata);
                    this._dtodn.ID = int.Parse(this.gridView1.GetRowCellValue(rowHandle, this.gridds_id).ToString());
                    if (!this._dtodn.Delete())
                    {
                        MessageBox.Show("Hủy th\x00f4ng tin đăng nhập thất bại", "Th\x00f4ng b\x00e1o");
                    }
                    else
                    {
                        this.f_load_dsdangnhap();
                        this.f_selected_dangnhap();
                    }
                }
            }
            catch
            {
            }
        }

        private void bbisua_ItemClick(object sender, ItemClickEventArgs e)
        {
            try
            {
                UCquanlydangnhap_edit _edit = new UCquanlydangnhap_edit();
                this._dtodn = new dtoDMDangNhap(this._condata);
                int rowHandle = this.gridView1.GetSelectedRows()[0];
                this._dtodn.ID = int.Parse(this.gridView1.GetRowCellValue(rowHandle, this.gridds_id).ToString());
                this._dtodn.Load();
                _edit.pDangNhap = this._dtodn;
                Form form = new Form();
                form.Controls.Add(_edit);
                form.ShowInTaskbar = false;
                form.StartPosition = FormStartPosition.CenterScreen;
                form.ControlBox = false;
                form.Width = _edit.Width + 10;
                form.Height = _edit.Height + 40;
                form.ShowIcon = false;
                form.Text = "Sửa th\x00f4ng tin đăng nhập";
                form.ShowDialog();
                this.f_load_dsdangnhap();
            }
            catch
            {
            }
        }

        private void bbithem_ItemClick(object sender, ItemClickEventArgs e)
        {
            UserControl control = new UCquanlydangnhap_edit();
            Form form = new Form();
            form.Controls.Add(control);
            form.ShowInTaskbar = false;
            form.StartPosition = FormStartPosition.CenterScreen;
            form.ControlBox = false;
            form.Width = control.Width + 10;
            form.Height = control.Height + 40;
            form.ShowIcon = false;
            form.Text = "Th\x00eam th\x00f4ng tin đăng nhập";
            form.ShowDialog();
            this.f_load_dsdangnhap();
        }

        private void btnketthuc_Click(object sender, EventArgs e)
        {
            try
            {
                XtraTabPage parent = (XtraTabPage) base.Parent;
                XtraTabControl control = (XtraTabControl) parent.Parent;
                control.TabPages.Remove(parent);
            }
            catch
            {
                XtraUserControl control2 = (XtraUserControl) base.Parent;
                control2.Controls.Remove(this);
            }
        }

        private void btnluu_Click(object sender, EventArgs e)
        {
            string str = "";
            foreach (TreeListNode node in this.treeList1.Nodes)
            {
                if (node.Checked)
                {
                    str = str + node.GetValue("ma") + ",";
                }
                if (node.Nodes.Count > 0)
                {
                    str = str + this.f_getNodeChild_check(node);
                }
            }
            string[] strArray = str.Trim(new char[] { ',' }).Split(new char[] { ',' });
            str = "";
            for (int i = 0; i < strArray.Length; i++)
            {
                if (str.IndexOf(strArray[i] + ",") == -1)
                {
                    str = str + strArray[i] + ",";
                }
            }
            str = str.Trim(new char[] { ',' });
            dtoDMDangNhap nhap = new dtoDMDangNhap(this._condata);
            int rowHandle = int.Parse(this.gridView1.GetSelectedRows()[0].ToString());
            nhap.ID = int.Parse(this.gridView1.GetRowCellValue(rowHandle, this.gridds_id).ToString());
            nhap.Load();
            nhap.QUYENSUDUNG = str;
            if (!nhap.Update())
            {
                MessageBox.Show("Lưu danh s\x00e1ch c\x00e1c chức năng kh\x00f4ng th\x00e0nh c\x00f4ng.", "Th\x00f4ng b\x00e1o", MessageBoxButtons.OK, MessageBoxIcon.Hand);
            }
            else
            {
                MessageBox.Show("Lưu th\x00e0nh c\x00f4ng.", "Th\x00f4ng b\x00e1o", MessageBoxButtons.OK);
                this.f_load_dsdangnhap();
                this.f_selected_dangnhap();
            }
        }

        private void contextMenuStrip1_VisibleChanged(object sender, EventArgs e)
        {
            this.smipast.Enabled = this._quyen_coppy != "";
            this.smiundo.Enabled = this._quyen_undo != "";
        }

        private void dánQuyềnSửDụngToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this._quyen_undo = this._quyen_ht;
            this._quyen_ht = this._quyen_coppy;
            this._quyen_coppy = "";
            this._dtodn.QUYENSUDUNG = this._quyen_ht;
            this._dtodn.Update();
            this.f_load_dsdangnhap();
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void f_checknode(string key)
        {
            key = key.Trim(new char[] { ',' }) + ",";
            foreach (TreeListNode node in this.treeList1.Nodes)
            {
                node.Checked = key.IndexOf(node.GetValue(1).ToString() + ",") > -1;
                if (node.HasChildren)
                {
                    this.f_searchnode(node, key);
                }
            }
        }

        private string f_getNodeChild_check(TreeListNode tln)
        {
            string str = "";
            foreach (TreeListNode node in tln.Nodes)
            {
                if (node.Checked)
                {
                    str = str + node.GetValue("ma") + ",";
                }
                if (node.Nodes.Count > 0)
                {
                    str = str + this.f_getNodeChild_check(node);
                }
            }
            return str;
        }

        private void f_load_chucnang()
        {
            if (this._dataChucNang != null)
            {
                TreeListNode parentNode = this.treeList1.AppendNode(new object[] { "Tất cả", 0, 0 }, (TreeListNode) null);
                string str = new dtoDSThongSo(this._condata).TVQuyenSuDung(1);
                foreach (DataRow row in this._dataChucNang.Select("cap=1"))
                {
                    TreeListNode node2 = this.treeList1.AppendNode(new object[] { row["ten"].ToString(), row["ma"].ToString(), row["cap"].ToString() }, parentNode);
                    node2.SetValue("ma", row["ma"].ToString());
                    foreach (DataRow row2 in this._dataChucNang.Select("cap=2 and ma like '" + row["ma"].ToString() + "%'"))
                    {
                        TreeListNode node3 = this.treeList1.AppendNode(new object[] { row2["ten"].ToString(), row2["ma"].ToString(), row2["cap"].ToString() }, node2);
                        node3.SetValue("ma", row2["ma"].ToString());
                        foreach (DataRow row3 in this._dataChucNang.Select("cap=3 and ma like'" + row2["ma"].ToString() + "%'"))
                        {
                            TreeListNode node4 = this.treeList1.AppendNode(new object[] { row3["ten"].ToString(), row3["ma"].ToString(), row3["cap"].ToString() }, node3);
                            node4.SetValue("ma", row3["ma"].ToString());
                            foreach (DataRow row4 in this._dataChucNang.Select("cap=4 and ma like'" + row3["ma"].ToString() + "%'"))
                            {
                                this.treeList1.AppendNode(new object[] { row4["ten"].ToString(), row4["ma"].ToString(), row4["cap"].ToString() }, node4).SetValue("ma", row4["ma"].ToString());
                            }
                        }
                    }
                }
                this.treeList1.ExpandAll();
                this.treeList1.Refresh();
            }
        }

        private void f_load_dsdangnhap()
        {
            DataTable table = this._dtodn.LoadAll();
            this.gridds.DataSource = table;
        }

        private void f_searchnode(TreeListNode _node, string key)
        {
            _node.Checked = key.IndexOf(_node.GetValue("ma").ToString() + ",") > -1;
            if (_node.HasChildren)
            {
                foreach (TreeListNode node in _node.Nodes)
                {
                    node.Checked = key.IndexOf(node.GetValue("ma").ToString() + ",") > -1;
                    if (node.HasChildren)
                    {
                        this.f_searchnode(node, key);
                    }
                }
            }
        }

        private void f_selected_dangnhap()
        {
            try
            {
                int rowHandle = this.gridView1.GetSelectedRows()[0];
                string key = this.gridView1.GetRowCellValue(rowHandle, this.gridds_quyensudung).ToString();
                this.f_checknode(key);
                this._dtodn = null;
                this._dtodn = new dtoDMDangNhap(this._condata);
                this._dtodn.ID = int.Parse(this.gridView1.GetRowCellValue(rowHandle, this.gridds_id).ToString());
                this._dtodn.Load();
                this._quyen_ht = this._dtodn.QUYENSUDUNG;
            }
            catch
            {
            }
        }

        private void f_setNodeChild_check(TreeListNode tln)
        {
            foreach (TreeListNode node in tln.Nodes)
            {
                node.Checked = tln.Checked;
                if (node.Nodes.Count > 0)
                {
                    this.f_setNodeChild_check(node);
                }
            }
        }

        private void gridView1_FocusedColumnChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedColumnChangedEventArgs e)
        {
            this.f_selected_dangnhap();
        }

        private void gridView1_FocusedColumnChanged(object sender, FocusedRowChangedEventArgs e)
        {
            this.f_selected_dangnhap();
        }

        private void gridView1_PopupMenuShowing(object sender, DevExpress.XtraGrid.Views.Grid.PopupMenuShowingEventArgs e)
        {
            if (this.gridView1.CalcHitInfo(e.Point).InRow)
            {
                this.contextMenuStrip1.Show(this.gridView1.GridControl, e.Point);
            }
        }

        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            DevExpress.XtraGrid.StyleFormatCondition styleFormatCondition1 = new DevExpress.XtraGrid.StyleFormatCondition();
            this.treeList1 = new DevExpress.XtraTreeList.TreeList();
            this.treeListColumn1 = new DevExpress.XtraTreeList.Columns.TreeListColumn();
            this.treeListColumn4 = new DevExpress.XtraTreeList.Columns.TreeListColumn();
            this.repositoryItemCheckEdit1 = new DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit();
            this.btnketthuc = new DevExpress.XtraEditors.SimpleButton();
            this.btnluu = new DevExpress.XtraEditors.SimpleButton();
            this.gridds = new DevExpress.XtraGrid.GridControl();
            this.gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView();
            this.gridds_tendangnhap = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridds_ten = new DevExpress.XtraGrid.Columns.GridColumn();
            this.repositoryItemTextEdit1 = new DevExpress.XtraEditors.Repository.RepositoryItemTextEdit();
            this.gridds_id = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridds_matkhau = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridds_nhomsudung = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridds_quyensudung = new DevExpress.XtraGrid.Columns.GridColumn();
            this.repositoryItemTextEdit2 = new DevExpress.XtraEditors.Repository.RepositoryItemTextEdit();
            this.bar1 = new DevExpress.XtraBars.Bar();
            this.bar2 = new DevExpress.XtraBars.Bar();
            this.barDockControlTop = new DevExpress.XtraBars.BarDockControl();
            this.barManager1 = new DevExpress.XtraBars.BarManager(this.components);
            this.bar3 = new DevExpress.XtraBars.Bar();
            this.bbithem = new DevExpress.XtraBars.BarButtonItem();
            this.bbisua = new DevExpress.XtraBars.BarButtonItem();
            this.bbihuy = new DevExpress.XtraBars.BarButtonItem();
            this.barDockControl1 = new DevExpress.XtraBars.BarDockControl();
            this.barDockControlBottom = new DevExpress.XtraBars.BarDockControl();
            this.barDockControlLeft = new DevExpress.XtraBars.BarDockControl();
            this.barDockControlRight = new DevExpress.XtraBars.BarDockControl();
            this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
            this.saoChépQuyềnSửDụngToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.smipast = new System.Windows.Forms.ToolStripMenuItem();
            this.smiundo = new System.Windows.Forms.ToolStripMenuItem();
            ((System.ComponentModel.ISupportInitialize)(this.treeList1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemCheckEdit1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.gridds)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.gridView1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemTextEdit1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemTextEdit2)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.barManager1)).BeginInit();
            this.contextMenuStrip1.SuspendLayout();
            this.SuspendLayout();
            // 
            // treeList1
            // 
            this.treeList1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
            | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
            this.treeList1.Appearance.Empty.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(243)))), ((int)(((byte)(243)))), ((int)(((byte)(243)))));
            this.treeList1.Appearance.Empty.Options.UseBackColor = true;
            this.treeList1.Appearance.EvenRow.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(223)))), ((int)(((byte)(223)))), ((int)(((byte)(223)))));
            this.treeList1.Appearance.EvenRow.BackColor2 = System.Drawing.Color.GhostWhite;
            this.treeList1.Appearance.EvenRow.Font = new System.Drawing.Font("Tahoma", 10F);
            this.treeList1.Appearance.EvenRow.ForeColor = System.Drawing.Color.Black;
            this.treeList1.Appearance.EvenRow.GradientMode = System.Drawing.Drawing2D.LinearGradientMode.ForwardDiagonal;
            this.treeList1.Appearance.EvenRow.Options.UseBackColor = true;
            this.treeList1.Appearance.EvenRow.Options.UseFont = true;
            this.treeList1.Appearance.EvenRow.Options.UseForeColor = true;
            this.treeList1.Appearance.FocusedCell.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(225)))));
            this.treeList1.Appearance.FocusedCell.Font = new System.Drawing.Font("Tahoma", 10F);
            this.treeList1.Appearance.FocusedCell.ForeColor = System.Drawing.Color.Black;
            this.treeList1.Appearance.FocusedCell.Options.UseBackColor = true;
            this.treeList1.Appearance.FocusedCell.Options.UseFont = true;
            this.treeList1.Appearance.FocusedCell.Options.UseForeColor = true;
            this.treeList1.Appearance.FocusedRow.BackColor = System.Drawing.Color.Navy;
            this.treeList1.Appearance.FocusedRow.BackColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(50)))), ((int)(((byte)(178)))));
            this.treeList1.Appearance.FocusedRow.Font = new System.Drawing.Font("Tahoma", 10F);
            this.treeList1.Appearance.FocusedRow.ForeColor = System.Drawing.Color.White;
            this.treeList1.Appearance.FocusedRow.Options.UseBackColor = true;
            this.treeList1.Appearance.FocusedRow.Options.UseFont = true;
            this.treeList1.Appearance.FocusedRow.Options.UseForeColor = true;
            this.treeList1.Appearance.FooterPanel.BackColor = System.Drawing.Color.Silver;
            this.treeList1.Appearance.FooterPanel.BorderColor = System.Drawing.Color.Silver;
            this.treeList1.Appearance.FooterPanel.Font = new System.Drawing.Font("Tahoma", 10F);
            this.treeList1.Appearance.FooterPanel.ForeColor = System.Drawing.Color.Black;
            this.treeList1.Appearance.FooterPanel.Options.UseBackColor = true;
            this.treeList1.Appearance.FooterPanel.Options.UseBorderColor = true;
            this.treeList1.Appearance.FooterPanel.Options.UseFont = true;
            this.treeList1.Appearance.FooterPanel.Options.UseForeColor = true;
            this.treeList1.Appearance.GroupButton.BackColor = System.Drawing.Color.Silver;
            this.treeList1.Appearance.GroupButton.BorderColor = System.Drawing.Color.Silver;
            this.treeList1.Appearance.GroupButton.ForeColor = System.Drawing.Color.Black;
            this.treeList1.Appearance.GroupButton.Options.UseBackColor = true;
            this.treeList1.Appearance.GroupButton.Options.UseBorderColor = true;
            this.treeList1.Appearance.GroupButton.Options.UseForeColor = true;
            this.treeList1.Appearance.GroupFooter.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(202)))), ((int)(((byte)(202)))), ((int)(((byte)(202)))));
            this.treeList1.Appearance.GroupFooter.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(202)))), ((int)(((byte)(202)))), ((int)(((byte)(202)))));
            this.treeList1.Appearance.GroupFooter.ForeColor = System.Drawing.Color.Black;
            this.treeList1.Appearance.GroupFooter.Options.UseBackColor = true;
            this.treeList1.Appearance.GroupFooter.Options.UseBorderColor = true;
            this.treeList1.Appearance.GroupFooter.Options.UseForeColor = true;
            this.treeList1.Appearance.HeaderPanel.BackColor = System.Drawing.Color.Silver;
            this.treeList1.Appearance.HeaderPanel.BorderColor = System.Drawing.Color.Silver;
            this.treeList1.Appearance.HeaderPanel.Font = new System.Drawing.Font("Tahoma", 10F, System.Drawing.FontStyle.Bold);
            this.treeList1.Appearance.HeaderPanel.ForeColor = System.Drawing.Color.Black;
            this.treeList1.Appearance.HeaderPanel.Options.UseBackColor = true;
            this.treeList1.Appearance.HeaderPanel.Options.UseBorderColor = true;
            this.treeList1.Appearance.HeaderPanel.Options.UseFont = true;
            this.treeList1.Appearance.HeaderPanel.Options.UseForeColor = true;
            this.treeList1.Appearance.HideSelectionRow.BackColor = System.Drawing.Color.Gray;
            this.treeList1.Appearance.HideSelectionRow.Font = new System.Drawing.Font("Tahoma", 10F);
            this.treeList1.Appearance.HideSelectionRow.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(212)))), ((int)(((byte)(208)))), ((int)(((byte)(200)))));
            this.treeList1.Appearance.HideSelectionRow.Options.UseBackColor = true;
            this.treeList1.Appearance.HideSelectionRow.Options.UseFont = true;
            this.treeList1.Appearance.HideSelectionRow.Options.UseForeColor = true;
            this.treeList1.Appearance.HorzLine.BackColor = System.Drawing.Color.Silver;
            this.treeList1.Appearance.HorzLine.Options.UseBackColor = true;
            this.treeList1.Appearance.OddRow.BackColor = System.Drawing.Color.White;
            this.treeList1.Appearance.OddRow.BackColor2 = System.Drawing.Color.White;
            this.treeList1.Appearance.OddRow.Font = new System.Drawing.Font("Tahoma", 10F);
            this.treeList1.Appearance.OddRow.ForeColor = System.Drawing.Color.Black;
            this.treeList1.Appearance.OddRow.GradientMode = System.Drawing.Drawing2D.LinearGradientMode.BackwardDiagonal;
            this.treeList1.Appearance.OddRow.Options.UseBackColor = true;
            this.treeList1.Appearance.OddRow.Options.UseFont = true;
            this.treeList1.Appearance.OddRow.Options.UseForeColor = true;
            this.treeList1.Appearance.Preview.BackColor = System.Drawing.Color.White;
            this.treeList1.Appearance.Preview.Font = new System.Drawing.Font("Tahoma", 10F);
            this.treeList1.Appearance.Preview.ForeColor = System.Drawing.Color.Navy;
            this.treeList1.Appearance.Preview.Options.UseBackColor = true;
            this.treeList1.Appearance.Preview.Options.UseFont = true;
            this.treeList1.Appearance.Preview.Options.UseForeColor = true;
            this.treeList1.Appearance.Row.BackColor = System.Drawing.Color.White;
            this.treeList1.Appearance.Row.Font = new System.Drawing.Font("Tahoma", 10F);
            this.treeList1.Appearance.Row.ForeColor = System.Drawing.Color.Black;
            this.treeList1.Appearance.Row.Options.UseBackColor = true;
            this.treeList1.Appearance.Row.Options.UseFont = true;
            this.treeList1.Appearance.Row.Options.UseForeColor = true;
            this.treeList1.Appearance.SelectedRow.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(10)))), ((int)(((byte)(10)))), ((int)(((byte)(138)))));
            this.treeList1.Appearance.SelectedRow.Font = new System.Drawing.Font("Tahoma", 10F);
            this.treeList1.Appearance.SelectedRow.ForeColor = System.Drawing.Color.White;
            this.treeList1.Appearance.SelectedRow.Options.UseBackColor = true;
            this.treeList1.Appearance.SelectedRow.Options.UseFont = true;
            this.treeList1.Appearance.SelectedRow.Options.UseForeColor = true;
            this.treeList1.Appearance.TreeLine.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(58)))), ((int)(((byte)(58)))), ((int)(((byte)(58)))));
            this.treeList1.Appearance.TreeLine.Options.UseBackColor = true;
            this.treeList1.Appearance.VertLine.BackColor = System.Drawing.Color.Silver;
            this.treeList1.Appearance.VertLine.Options.UseBackColor = true;
            this.treeList1.Columns.AddRange(new DevExpress.XtraTreeList.Columns.TreeListColumn[] {
            this.treeListColumn1,
            this.treeListColumn4});
            this.treeList1.Font = new System.Drawing.Font("Tahoma", 10F);
            this.treeList1.Location = new System.Drawing.Point(333, 3);
            this.treeList1.Name = "treeList1";
            this.treeList1.OptionsView.EnableAppearanceEvenRow = true;
            this.treeList1.OptionsView.EnableAppearanceOddRow = true;
            this.treeList1.OptionsView.ShowCheckBoxes = true;
            this.treeList1.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
            this.repositoryItemCheckEdit1});
            this.treeList1.Size = new System.Drawing.Size(532, 486);
            this.treeList1.TabIndex = 1;
            this.treeList1.AfterCheckNode += new DevExpress.XtraTreeList.NodeEventHandler(this.treeList1_AfterCheckNode);
            this.treeList1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.UCquanlydangnhap_KeyDown);
            // 
            // treeListColumn1
            // 
            this.treeListColumn1.Caption = "Chức năng";
            this.treeListColumn1.FieldName = "Chức năng";
            this.treeListColumn1.MinWidth = 32;
            this.treeListColumn1.Name = "treeListColumn1";
            this.treeListColumn1.OptionsColumn.AllowEdit = false;
            this.treeListColumn1.OptionsColumn.ReadOnly = true;
            this.treeListColumn1.Visible = true;
            this.treeListColumn1.VisibleIndex = 0;
            this.treeListColumn1.Width = 391;
            // 
            // treeListColumn4
            // 
            this.treeListColumn4.Caption = "ma";
            this.treeListColumn4.FieldName = "ma";
            this.treeListColumn4.Name = "treeListColumn4";
            // 
            // repositoryItemCheckEdit1
            // 
            this.repositoryItemCheckEdit1.AutoHeight = false;
            this.repositoryItemCheckEdit1.Name = "repositoryItemCheckEdit1";
            // 
            // btnketthuc
            // 
            this.btnketthuc.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
            this.btnketthuc.Appearance.Options.UseTextOptions = true;
            this.btnketthuc.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
            this.btnketthuc.Location = new System.Drawing.Point(87, 495);
            this.btnketthuc.Name = "btnketthuc";
            this.btnketthuc.Size = new System.Drawing.Size(106, 23);
            this.btnketthuc.TabIndex = 20;
            this.btnketthuc.Text = " &Kết thúc [F12]";
            this.btnketthuc.Click += new System.EventHandler(this.btnketthuc_Click);
            this.btnketthuc.Image = Resources.Reso.imgclose;
            // 
            // btnluu
            // 
            this.btnluu.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
            this.btnluu.Appearance.Options.UseTextOptions = true;
            this.btnluu.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
            this.btnluu.Location = new System.Drawing.Point(3, 495);
            this.btnluu.Name = "btnluu";
            this.btnluu.Size = new System.Drawing.Size(78, 23);
            this.btnluu.TabIndex = 21;
            this.btnluu.Text = " &Lưu [F5]";
            this.btnluu.Click += new System.EventHandler(this.btnluu_Click);
            this.btnluu.Image = Resources.Reso.imgsave;
            // 
            // gridds
            // 
            this.gridds.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
            | System.Windows.Forms.AnchorStyles.Left)));
            this.gridds.Location = new System.Drawing.Point(0, 29);
            this.gridds.MainView = this.gridView1;
            this.gridds.Name = "gridds";
            this.gridds.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
            this.repositoryItemTextEdit1,
            this.repositoryItemTextEdit2});
            this.gridds.Size = new System.Drawing.Size(327, 460);
            this.gridds.TabIndex = 22;
            this.gridds.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
            this.gridView1});
            this.gridds.KeyDown += new System.Windows.Forms.KeyEventHandler(this.UCquanlydangnhap_KeyDown);
            // 
            // gridView1
            // 
            this.gridView1.Appearance.ColumnFilterButton.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(232)))), ((int)(((byte)(201)))));
            this.gridView1.Appearance.ColumnFilterButton.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(232)))), ((int)(((byte)(201)))));
            this.gridView1.Appearance.ColumnFilterButton.ForeColor = System.Drawing.Color.Black;
            this.gridView1.Appearance.ColumnFilterButton.Options.UseBackColor = true;
            this.gridView1.Appearance.ColumnFilterButton.Options.UseBorderColor = true;
            this.gridView1.Appearance.ColumnFilterButton.Options.UseForeColor = true;
            this.gridView1.Appearance.ColumnFilterButtonActive.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(221)))), ((int)(((byte)(231)))), ((int)(((byte)(234)))));
            this.gridView1.Appearance.ColumnFilterButtonActive.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(221)))), ((int)(((byte)(231)))), ((int)(((byte)(234)))));
            this.gridView1.Appearance.ColumnFilterButtonActive.ForeColor = System.Drawing.Color.Black;
            this.gridView1.Appearance.ColumnFilterButtonActive.Options.UseBackColor = true;
            this.gridView1.Appearance.ColumnFilterButtonActive.Options.UseBorderColor = true;
            this.gridView1.Appearance.ColumnFilterButtonActive.Options.UseForeColor = true;
            this.gridView1.Appearance.Empty.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(232)))), ((int)(((byte)(201)))));
            this.gridView1.Appearance.Empty.BackColor2 = System.Drawing.Color.White;
            this.gridView1.Appearance.Empty.Options.UseBackColor = true;
            this.gridView1.Appearance.EvenRow.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(221)))), ((int)(((byte)(231)))), ((int)(((byte)(234)))));
            this.gridView1.Appearance.EvenRow.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(221)))), ((int)(((byte)(231)))), ((int)(((byte)(234)))));
            this.gridView1.Appearance.EvenRow.ForeColor = System.Drawing.Color.Black;
            this.gridView1.Appearance.EvenRow.Options.UseBackColor = true;
            this.gridView1.Appearance.EvenRow.Options.UseBorderColor = true;
            this.gridView1.Appearance.EvenRow.Options.UseForeColor = true;
            this.gridView1.Appearance.FilterCloseButton.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(209)))), ((int)(((byte)(179)))));
            this.gridView1.Appearance.FilterCloseButton.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(209)))), ((int)(((byte)(179)))));
            this.gridView1.Appearance.FilterCloseButton.ForeColor = System.Drawing.Color.Black;
            this.gridView1.Appearance.FilterCloseButton.Options.UseBackColor = true;
            this.gridView1.Appearance.FilterCloseButton.Options.UseBorderColor = true;
            this.gridView1.Appearance.FilterCloseButton.Options.UseForeColor = true;
            this.gridView1.Appearance.FilterPanel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(232)))), ((int)(((byte)(201)))));
            this.gridView1.Appearance.FilterPanel.BackColor2 = System.Drawing.Color.White;
            this.gridView1.Appearance.FilterPanel.ForeColor = System.Drawing.Color.Black;
            this.gridView1.Appearance.FilterPanel.Options.UseBackColor = true;
            this.gridView1.Appearance.FilterPanel.Options.UseForeColor = true;
            this.gridView1.Appearance.FixedLine.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(122)))), ((int)(((byte)(114)))), ((int)(((byte)(113)))));
            this.gridView1.Appearance.FixedLine.Options.UseBackColor = true;
            this.gridView1.Appearance.FocusedCell.BackColor = System.Drawing.Color.White;
            this.gridView1.Appearance.FocusedCell.ForeColor = System.Drawing.Color.Black;
            this.gridView1.Appearance.FocusedCell.Options.UseBackColor = true;
            this.gridView1.Appearance.FocusedCell.Options.UseForeColor = true;
            this.gridView1.Appearance.FocusedRow.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(200)))), ((int)(((byte)(192)))), ((int)(((byte)(157)))));
            this.gridView1.Appearance.FocusedRow.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(226)))), ((int)(((byte)(219)))), ((int)(((byte)(188)))));
            this.gridView1.Appearance.FocusedRow.ForeColor = System.Drawing.Color.Black;
            this.gridView1.Appearance.FocusedRow.Options.UseBackColor = true;
            this.gridView1.Appearance.FocusedRow.Options.UseBorderColor = true;
            this.gridView1.Appearance.FocusedRow.Options.UseForeColor = true;
            this.gridView1.Appearance.FooterPanel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(209)))), ((int)(((byte)(170)))));
            this.gridView1.Appearance.FooterPanel.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(209)))), ((int)(((byte)(170)))));
            this.gridView1.Appearance.FooterPanel.ForeColor = System.Drawing.Color.Black;
            this.gridView1.Appearance.FooterPanel.Options.UseBackColor = true;
            this.gridView1.Appearance.FooterPanel.Options.UseBorderColor = true;
            this.gridView1.Appearance.FooterPanel.Options.UseForeColor = true;
            this.gridView1.Appearance.GroupButton.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(209)))), ((int)(((byte)(179)))));
            this.gridView1.Appearance.GroupButton.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(209)))), ((int)(((byte)(179)))));
            this.gridView1.Appearance.GroupButton.Options.UseBackColor = true;
            this.gridView1.Appearance.GroupButton.Options.UseBorderColor = true;
            this.gridView1.Appearance.GroupFooter.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(232)))), ((int)(((byte)(201)))));
            this.gridView1.Appearance.GroupFooter.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(232)))), ((int)(((byte)(201)))));
            this.gridView1.Appearance.GroupFooter.ForeColor = System.Drawing.Color.Black;
            this.gridView1.Appearance.GroupFooter.Options.UseBackColor = true;
            this.gridView1.Appearance.GroupFooter.Options.UseBorderColor = true;
            this.gridView1.Appearance.GroupFooter.Options.UseForeColor = true;
            this.gridView1.Appearance.GroupPanel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(246)))), ((int)(((byte)(242)))), ((int)(((byte)(213)))));
            this.gridView1.Appearance.GroupPanel.BackColor2 = System.Drawing.Color.White;
            this.gridView1.Appearance.GroupPanel.ForeColor = System.Drawing.Color.Black;
            this.gridView1.Appearance.GroupPanel.Options.UseBackColor = true;
            this.gridView1.Appearance.GroupPanel.Options.UseForeColor = true;
            this.gridView1.Appearance.GroupRow.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(232)))), ((int)(((byte)(201)))));
            this.gridView1.Appearance.GroupRow.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(232)))), ((int)(((byte)(201)))));
            this.gridView1.Appearance.GroupRow.ForeColor = System.Drawing.Color.Black;
            this.gridView1.Appearance.GroupRow.Options.UseBackColor = true;
            this.gridView1.Appearance.GroupRow.Options.UseBorderColor = true;
            this.gridView1.Appearance.GroupRow.Options.UseForeColor = true;
            this.gridView1.Appearance.HeaderPanel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(209)))), ((int)(((byte)(170)))));
            this.gridView1.Appearance.HeaderPanel.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(209)))), ((int)(((byte)(170)))));
            this.gridView1.Appearance.HeaderPanel.ForeColor = System.Drawing.Color.Black;
            this.gridView1.Appearance.HeaderPanel.Options.UseBackColor = true;
            this.gridView1.Appearance.HeaderPanel.Options.UseBorderColor = true;
            this.gridView1.Appearance.HeaderPanel.Options.UseForeColor = true;
            this.gridView1.Appearance.HideSelectionRow.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(237)))), ((int)(((byte)(230)))), ((int)(((byte)(203)))));
            this.gridView1.Appearance.HideSelectionRow.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(237)))), ((int)(((byte)(230)))), ((int)(((byte)(203)))));
            this.gridView1.Appearance.HideSelectionRow.ForeColor = System.Drawing.Color.Black;
            this.gridView1.Appearance.HideSelectionRow.Options.UseBackColor = true;
            this.gridView1.Appearance.HideSelectionRow.Options.UseBorderColor = true;
            this.gridView1.Appearance.HideSelectionRow.Options.UseForeColor = true;
            this.gridView1.Appearance.HorzLine.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(209)))), ((int)(((byte)(170)))));
            this.gridView1.Appearance.HorzLine.Options.UseBackColor = true;
            this.gridView1.Appearance.OddRow.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(242)))), ((int)(((byte)(244)))), ((int)(((byte)(236)))));
            this.gridView1.Appearance.OddRow.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(242)))), ((int)(((byte)(244)))), ((int)(((byte)(236)))));
            this.gridView1.Appearance.OddRow.ForeColor = System.Drawing.Color.Black;
            this.gridView1.Appearance.OddRow.Options.UseBackColor = true;
            this.gridView1.Appearance.OddRow.Options.UseBorderColor = true;
            this.gridView1.Appearance.OddRow.Options.UseForeColor = true;
            this.gridView1.Appearance.Preview.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(251)))), ((int)(((byte)(252)))), ((int)(((byte)(247)))));
            this.gridView1.Appearance.Preview.Font = new System.Drawing.Font("Verdana", 7.5F);
            this.gridView1.Appearance.Preview.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(148)))), ((int)(((byte)(148)))), ((int)(((byte)(148)))));
            this.gridView1.Appearance.Preview.Options.UseBackColor = true;
            this.gridView1.Appearance.Preview.Options.UseFont = true;
            this.gridView1.Appearance.Preview.Options.UseForeColor = true;
            this.gridView1.Appearance.Row.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(242)))), ((int)(((byte)(244)))), ((int)(((byte)(236)))));
            this.gridView1.Appearance.Row.ForeColor = System.Drawing.Color.Black;
            this.gridView1.Appearance.Row.Options.UseBackColor = true;
            this.gridView1.Appearance.Row.Options.UseForeColor = true;
            this.gridView1.Appearance.RowSeparator.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(232)))), ((int)(((byte)(201)))));
            this.gridView1.Appearance.RowSeparator.BackColor2 = System.Drawing.Color.White;
            this.gridView1.Appearance.RowSeparator.Options.UseBackColor = true;
            this.gridView1.Appearance.SelectedRow.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(221)))), ((int)(((byte)(215)))), ((int)(((byte)(188)))));
            this.gridView1.Appearance.SelectedRow.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(237)))), ((int)(((byte)(230)))), ((int)(((byte)(203)))));
            this.gridView1.Appearance.SelectedRow.ForeColor = System.Drawing.Color.Black;
            this.gridView1.Appearance.SelectedRow.Options.UseBackColor = true;
            this.gridView1.Appearance.SelectedRow.Options.UseBorderColor = true;
            this.gridView1.Appearance.SelectedRow.Options.UseForeColor = true;
            this.gridView1.Appearance.TopNewRow.BackColor = System.Drawing.Color.White;
            this.gridView1.Appearance.TopNewRow.Options.UseBackColor = true;
            this.gridView1.Appearance.VertLine.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(209)))), ((int)(((byte)(170)))));
            this.gridView1.Appearance.VertLine.Options.UseBackColor = true;
            this.gridView1.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
            this.gridds_tendangnhap,
            this.gridds_ten,
            this.gridds_id,
            this.gridds_matkhau,
            this.gridds_nhomsudung,
            this.gridds_quyensudung});
            styleFormatCondition1.Appearance.ForeColor = System.Drawing.Color.Red;
            styleFormatCondition1.Appearance.Options.UseForeColor = true;
            styleFormatCondition1.Condition = DevExpress.XtraGrid.FormatConditionEnum.Between;
            styleFormatCondition1.Value1 = "0";
            styleFormatCondition1.Value2 = "0";
            this.gridView1.FormatConditions.AddRange(new DevExpress.XtraGrid.StyleFormatCondition[] {
            styleFormatCondition1});
            this.gridView1.GridControl = this.gridds;
            this.gridView1.Name = "gridView1";
            this.gridView1.OptionsBehavior.AllowAddRows = DevExpress.Utils.DefaultBoolean.True;
            this.gridView1.OptionsBehavior.AllowDeleteRows = DevExpress.Utils.DefaultBoolean.False;
            this.gridView1.OptionsBehavior.ReadOnly = true;
            this.gridView1.OptionsView.AutoCalcPreviewLineCount = true;
            this.gridView1.OptionsView.EnableAppearanceEvenRow = true;
            this.gridView1.OptionsView.EnableAppearanceOddRow = true;
            this.gridView1.OptionsView.ShowAutoFilterRow = true;
            this.gridView1.OptionsView.ShowFooter = true;
            this.gridView1.OptionsView.ShowGroupPanel = false;
            this.gridView1.PopupMenuShowing += new DevExpress.XtraGrid.Views.Grid.PopupMenuShowingEventHandler(this.gridView1_PopupMenuShowing);
            this.gridView1.FocusedRowChanged += new DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventHandler(this.gridView1_FocusedColumnChanged);
            this.gridView1.FocusedColumnChanged += new DevExpress.XtraGrid.Views.Base.FocusedColumnChangedEventHandler(this.gridView1_FocusedColumnChanged);
            // 
            // gridds_tendangnhap
            // 
            this.gridds_tendangnhap.Caption = "Tên đăng nhập";
            this.gridds_tendangnhap.FieldName = "tendangnhap";
            this.gridds_tendangnhap.Name = "gridds_tendangnhap";
            this.gridds_tendangnhap.OptionsColumn.AllowEdit = false;
            this.gridds_tendangnhap.Visible = true;
            this.gridds_tendangnhap.VisibleIndex = 0;
            this.gridds_tendangnhap.Width = 109;
            // 
            // gridds_ten
            // 
            this.gridds_ten.Caption = "Họ và tên";
            this.gridds_ten.ColumnEdit = this.repositoryItemTextEdit1;
            this.gridds_ten.FieldName = "tennguoidung";
            this.gridds_ten.Name = "gridds_ten";
            this.gridds_ten.OptionsColumn.AllowEdit = false;
            this.gridds_ten.OptionsFilter.AutoFilterCondition = DevExpress.XtraGrid.Columns.AutoFilterCondition.Like;
            this.gridds_ten.Visible = true;
            this.gridds_ten.VisibleIndex = 1;
            this.gridds_ten.Width = 200;
            // 
            // repositoryItemTextEdit1
            // 
            this.repositoryItemTextEdit1.AutoHeight = false;
            this.repositoryItemTextEdit1.Name = "repositoryItemTextEdit1";
            this.repositoryItemTextEdit1.ReadOnly = true;
            // 
            // gridds_id
            // 
            this.gridds_id.Caption = "id";
            this.gridds_id.FieldName = "id";
            this.gridds_id.Name = "gridds_id";
            // 
            // gridds_matkhau
            // 
            this.gridds_matkhau.Caption = "matkhau";
            this.gridds_matkhau.FieldName = "matkhau";
            this.gridds_matkhau.Name = "gridds_matkhau";
            // 
            // gridds_nhomsudung
            // 
            this.gridds_nhomsudung.Caption = "gridColumn1";
            this.gridds_nhomsudung.FieldName = "nhomsudung";
            this.gridds_nhomsudung.Name = "gridds_nhomsudung";
            // 
            // gridds_quyensudung
            // 
            this.gridds_quyensudung.Caption = "gridColumn1";
            this.gridds_quyensudung.FieldName = "quyensudung";
            this.gridds_quyensudung.Name = "gridds_quyensudung";
            // 
            // repositoryItemTextEdit2
            // 
            this.repositoryItemTextEdit2.AutoHeight = false;
            this.repositoryItemTextEdit2.DisplayFormat.FormatString = "n0";
            this.repositoryItemTextEdit2.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
            this.repositoryItemTextEdit2.EditFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
            this.repositoryItemTextEdit2.Mask.EditMask = "n0";
            this.repositoryItemTextEdit2.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;
            this.repositoryItemTextEdit2.Name = "repositoryItemTextEdit2";
            // 
            // bar1
            // 
            this.bar1.BarName = "Tools";
            this.bar1.DockCol = 0;
            this.bar1.DockRow = 0;
            this.bar1.DockStyle = DevExpress.XtraBars.BarDockStyle.Top;
            this.bar1.Text = "Tools";
            // 
            // bar2
            // 
            this.bar2.BarName = "Tools";
            this.bar2.DockCol = 0;
            this.bar2.DockRow = 0;
            this.bar2.DockStyle = DevExpress.XtraBars.BarDockStyle.Top;
            this.bar2.Text = "Tools";
            // 
            // barDockControlTop
            // 
            this.barDockControlTop.CausesValidation = false;
            this.barDockControlTop.Dock = System.Windows.Forms.DockStyle.Top;
            this.barDockControlTop.Location = new System.Drawing.Point(0, 29);
            this.barDockControlTop.Size = new System.Drawing.Size(868, 31);
            // 
            // barManager1
            // 
            this.barManager1.Bars.AddRange(new DevExpress.XtraBars.Bar[] {
            this.bar3});
            this.barManager1.DockControls.Add(this.barDockControl1);
            this.barManager1.DockControls.Add(this.barDockControlBottom);
            this.barManager1.DockControls.Add(this.barDockControlLeft);
            this.barManager1.DockControls.Add(this.barDockControlRight);
            this.barManager1.Form = this;
            this.barManager1.Items.AddRange(new DevExpress.XtraBars.BarItem[] {
            this.bbithem,
            this.bbisua,
            this.bbihuy});
            this.barManager1.MaxItemId = 3;
            // 
            // bar3
            // 
            this.bar3.BarName = "Tools";
            this.bar3.DockCol = 0;
            this.bar3.DockRow = 0;
            this.bar3.DockStyle = DevExpress.XtraBars.BarDockStyle.Top;
            this.bar3.FloatLocation = new System.Drawing.Point(46, 143);
            this.bar3.LinksPersistInfo.AddRange(new DevExpress.XtraBars.LinkPersistInfo[] {
            new DevExpress.XtraBars.LinkPersistInfo(((DevExpress.XtraBars.BarLinkUserDefines)((DevExpress.XtraBars.BarLinkUserDefines.PaintStyle | DevExpress.XtraBars.BarLinkUserDefines.KeyTip))), this.bbithem, "", false, true, true, 0, null, DevExpress.XtraBars.BarItemPaintStyle.CaptionGlyph, "HKJFDHASKF", ""),
            new DevExpress.XtraBars.LinkPersistInfo(DevExpress.XtraBars.BarLinkUserDefines.PaintStyle, this.bbisua, DevExpress.XtraBars.BarItemPaintStyle.CaptionGlyph),
            new DevExpress.XtraBars.LinkPersistInfo(DevExpress.XtraBars.BarLinkUserDefines.PaintStyle, this.bbihuy, DevExpress.XtraBars.BarItemPaintStyle.CaptionGlyph)});
            this.bar3.OptionsBar.AllowQuickCustomization = false;
            this.bar3.Text = "Tools";
            // 
            // bbithem
            // 
            this.bbithem.Caption = "Thêm";
            this.bbithem.Id = 0;
            this.bbithem.Name = "bbithem";
            this.bbithem.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.bbithem_ItemClick);
            this.bbithem.Glyph = Resources.Reso.imgadd;
            // 
            // bbisua
            // 
            this.bbisua.Caption = "Sửa";
            this.bbisua.Id = 1;
            this.bbisua.Name = "bbisua";
            this.bbisua.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.bbisua_ItemClick);
            this.bbisua.Glyph = Resources.Reso.imgedit;
            // 
            // bbihuy
            // 
            this.bbihuy.Caption = "Hủy";
            this.bbihuy.Description = "Hủy thông tin đăng nhập";
            this.bbihuy.Id = 2;
            this.bbihuy.Name = "bbihuy";
            this.bbihuy.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.bbihuy_ItemClick);
            this.bbihuy.Glyph = Resources.Reso.imgdelete;
            // 
            // barDockControl1
            // 
            this.barDockControl1.CausesValidation = false;
            this.barDockControl1.Dock = System.Windows.Forms.DockStyle.Top;
            this.barDockControl1.Location = new System.Drawing.Point(0, 0);
            this.barDockControl1.Size = new System.Drawing.Size(868, 29);
            // 
            // barDockControlBottom
            // 
            this.barDockControlBottom.CausesValidation = false;
            this.barDockControlBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
            this.barDockControlBottom.Location = new System.Drawing.Point(0, 521);
            this.barDockControlBottom.Size = new System.Drawing.Size(868, 0);
            // 
            // barDockControlLeft
            // 
            this.barDockControlLeft.CausesValidation = false;
            this.barDockControlLeft.Dock = System.Windows.Forms.DockStyle.Left;
            this.barDockControlLeft.Location = new System.Drawing.Point(0, 29);
            this.barDockControlLeft.Size = new System.Drawing.Size(0, 492);
            // 
            // barDockControlRight
            // 
            this.barDockControlRight.CausesValidation = false;
            this.barDockControlRight.Dock = System.Windows.Forms.DockStyle.Right;
            this.barDockControlRight.Location = new System.Drawing.Point(868, 29);
            this.barDockControlRight.Size = new System.Drawing.Size(0, 492);
            // 
            // contextMenuStrip1
            // 
            this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.saoChépQuyềnSửDụngToolStripMenuItem,
            this.smipast,
            this.smiundo});
            this.contextMenuStrip1.Name = "contextMenuStrip1";
            this.contextMenuStrip1.Size = new System.Drawing.Size(205, 70);
            this.contextMenuStrip1.VisibleChanged += new System.EventHandler(this.contextMenuStrip1_VisibleChanged);
            // 
            // saoChépQuyềnSửDụngToolStripMenuItem
            // 
            this.saoChépQuyềnSửDụngToolStripMenuItem.Image = Resources.Reso.imgcopy;
            this.saoChépQuyềnSửDụngToolStripMenuItem.Name = "saoChépQuyềnSửDụngToolStripMenuItem";
            this.saoChépQuyềnSửDụngToolStripMenuItem.Size = new System.Drawing.Size(204, 22);
            this.saoChépQuyềnSửDụngToolStripMenuItem.Text = "Sao chép quyền sử dụng";
            this.saoChépQuyềnSửDụngToolStripMenuItem.Click += new System.EventHandler(this.saoChépQuyềnSửDụngToolStripMenuItem_Click);
            // 
            // smipast
            // 
            this.smipast.Image = Resources.Reso.imgpaste;
            this.smipast.Name = "smipast";
            this.smipast.Size = new System.Drawing.Size(204, 22);
            this.smipast.Text = "Dán quyền sử dụng";
            this.smipast.Click += new System.EventHandler(this.dánQuyềnSửDụngToolStripMenuItem_Click);
            // 
            // smiundo
            // 
            this.smiundo.Image = Resources.Reso.imgundo;
            this.smiundo.Name = "smiundo";
            this.smiundo.Size = new System.Drawing.Size(204, 22);
            this.smiundo.Text = "Quay lại";
            this.smiundo.Click += new System.EventHandler(this.quayLạiToolStripMenuItem_Click);
            // 
            // UCquanlydangnhap
            // 
            this.Controls.Add(this.gridds);
            this.Controls.Add(this.btnluu);
            this.Controls.Add(this.btnketthuc);
            this.Controls.Add(this.treeList1);
            this.Controls.Add(this.barDockControlTop);
            this.Controls.Add(this.barDockControlLeft);
            this.Controls.Add(this.barDockControlRight);
            this.Controls.Add(this.barDockControlBottom);
            this.Controls.Add(this.barDockControl1);
            this.LookAndFeel.UseWindowsXPTheme = true;
            this.Name = "UCquanlydangnhap";
            this.Size = new System.Drawing.Size(868, 521);
            this.Load += new System.EventHandler(this.UCphanquyensudung_Load);
            this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.UCquanlydangnhap_KeyDown);
            ((System.ComponentModel.ISupportInitialize)(this.treeList1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemCheckEdit1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.gridds)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.gridView1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemTextEdit1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemTextEdit2)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.barManager1)).EndInit();
            this.contextMenuStrip1.ResumeLayout(false);
            this.ResumeLayout(false);

        }

        private void quayLạiToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this._quyen_ht = this._quyen_undo;
            this._quyen_undo = "";
            this._dtodn.QUYENSUDUNG = this._quyen_ht;
            this._dtodn.Update();
            this.f_load_dsdangnhap();
        }

        private void saoChépQuyềnSửDụngToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this._quyen_coppy = this._quyen_ht;
        }

        public virtual void stbnketthuc_Click(object sender, EventArgs e)
        {
            XtraTabPage parent = (XtraTabPage) base.Parent;
            XtraTabControl control = (XtraTabControl) parent.Parent;
            control.TabPages.Remove(parent);
        }

        private void treeList1_AfterCheckNode(object sender, NodeEventArgs e)
        {
            if (e.Node.HasChildren)
            {
                this.f_setNodeChild_check(e.Node);
            }
        }

        private void UCphanquyensudung_Load(object sender, EventArgs e)
        {
            if (this._condata == null)
            {
                this._condata = new ConnectDatabase();
            }
            this._dtodn = new dtoDMDangNhap(this._condata);
            this.f_load_chucnang();
            this.f_load_dsdangnhap();
        }

        private void UCquanlydangnhap_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.F5)
            {
                this.btnluu_Click(null, null);
            }
            else if (e.KeyCode == Keys.F12)
            {
                this.btnketthuc_Click(null, null);
            }
        }

        public DataTable pChucNang
        {
            get
            {
                return this._dataChucNang;
            }
            set
            {
                this._dataChucNang = value;
            }
        }

        public ConnectDatabase pCondata
        {
            get
            {
                return this._condata;
            }
            set
            {
                this._condata = value;
            }
        }
    }
}

